<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html  xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<base href="<%=basePath%>">
<title>核心产品导入</title>
	<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
	<script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
	<script type="text/javascript">
	var startP = 1;
	
$(document).ready(function() {
	//上传excel事件
	$("#buttonUpload").click(function(){
		$.openLoading();
		var fileNameStr = $('#fileToUpload').val();
		fileNameStr = fileNameStr+"";
		var lastDotIndex = fileNameStr.lastIndexOf(".");
		if(lastDotIndex==-1){
			$.closeLoading();
			$.message("error","请选择扩展名为 .xls 的文件上传");
			return;
		}else{
			var extName = fileNameStr.substring(lastDotIndex+1, fileNameStr.length);
			if(extName.toLowerCase() != "xls"){
				$.closeLoading();
				$.message("error","请选择扩展名为 .xls 的文件上传");
				return;
			}
		}
		$.ajaxFileUpload({
	        url:'<%=path%>/nlifeCoreProduct/xlsImportNlifeCoreProdFileUpload',
	        fileElementId :'fileToUpload',//file控件id
	        dataType: 'json',
	        success : function (data){
	        	$.closeLoading();
	        	if(data.result=="error"||data.result=="fail"){
	        		$.dialog({
		    			width: 358,
		    			top:40,
		    			modal:true,
		    			Close:true,
		    			cancel:null,
		    			content: data.message
		    		});
		        	return;
	        	}
	        	if($.validate(data)) return;
	        	queryAgentMtInfo(1);
	        }
		});
	});
});
	
	</script>
</head>
<body >
	<div class="current">
           <table class="current_table_1">
              <tbody>
                <tr class="f2">
                  <td>
                    <img src="./images/current_1.jpg">
                  </td>
                  <td class="current_table_1_td">
                    <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
                      <span style=" color:#136bab; ">新意健险产品管理
                      <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>核心产品导入
                  </span>
                  </td>
                  <td><img src="./images/current_3.jpg"></td>
              </tr>
           </tbody>
         </table>
      </div>
		
		<table class="table_02" id="table">
			<tr>
				<td>
					<table border="1" class="table_02" style="height:50px">
						<tr>
			  				<td width="40%" nowrap="nowrap"><a href="<%=path%>/nlifeCoreProduct/downloadCoreProd" >&nbsp;&nbsp;新意健险核心产品模板下载&nbsp;</a></td>
			  				<td width="60%" nowrap="nowrap"><input  id="fileToUpload" name="myfiles" type='file' size='20'/><a href="javascript:void(0);" id="buttonUpload">&nbsp;&nbsp;导入新意健险核心产品&nbsp;&nbsp;</a></td>
			  			</tr>
					</table>
				</td>
			</tr>
		</table>
		
		<div id="Loading" style="display:none" align="center">
			<img src="./images/loading.gif" />
		</div>
		
	<!-- 结束 -->
</body>
</html>